<#-- 导入模版定义文件-->
<#include "../template/template_listPage.ftl">
<@header title="卡密产品管理">
<style type="text/css">
    .table {
        padding: 1px;
        text-align: center;
    }
</style>
<script type="text/javascript">
    function query() {
        $('#listForm').submit();
    }
    function saleStaticstics() {
        // window.open("${web_base}/recharge/card_management!saleStatistics.htm");
        ymPrompt.win('${web_base}/recharge/card_management!saleStatistics.htm', 600, 400, '销量统计', null, null, null, {id:'a'});
    }
    /**
     * 添加库存
     */
    function addReserve() {
        window.location.href = '${web_base}/recharge/system_product!toAdd.htm';
    }
    function stockSupplierManagement() {
        ymPrompt.win('${web_base}/recharge/stock_supplier!list.htm', 600, 400, '进货源', null, null, null, {id:'b'});
    }
    function batchOperation() {
        ymPrompt.win('${web_base}/recharge/card_info!toBatchOperate.htm', 400, 150, '批量操作', null, null, null, {id:'b'});
    }
</script>
</@header>
<body class="list">
<div class="body">
    <div class="listBar">
        <h1><span class="icon">&nbsp;</span>卡密产品管理&nbsp;<span class="pageInfo">总记录数:<#if page??>${page.rowCount}</#if>
            (共<#if page??>${page.pageCount}</#if>页)</span></h1>
    </div>
<@pageList page=(page!) id="listForm" action="" query="systemProductQuery" isEmpty=true>
    <div class="operateBar">
        <label>产品名称:</label>
        <input type="text" name="cardName" value="${cardName!}" id="cardName"/>&nbsp;
        <button type="button" onclick="query();">查询</button>&nbsp;
        <button type="button" onclick="addReserve();">添加库存产品</button>&nbsp;
        <button type="button" onclick="batchOperation();">批量操作</button>&nbsp;
    <#--   <button type="button">导入&删除日志</button> -->
        <button type="button" onclick="stockSupplierManagement();">进货源管理</button>&nbsp;
        <button type="button" onclick="saleStaticstics();">销量统计</button>
    <#--    <button type="button">库存修改</button> -->
    </div>
    <table class="listTable">
        <tr>
            <th><span class="sort">序号</span></th>
            <th><span class="sort">产品名称</span></th>
            <th><span class="sort">当前数量</span></th>
            <th><span class="sort">错卡数</span></th>
            <th><span class="sort">操作</span></th>
        </tr>
        <#if  page??&&page.list??&&(page.list?size gt 0) >
            <#list page.list as obj>
                <tr>
                    <td>${obj_index+page.pageSize*(page.currentPage-1)+1}</td>
                    <td><a href="${web_base}/recharge/system_product!toEdit.htm?id=${obj.id!}">${obj.name!}</a></td>
                    <td>${obj.cardNumber!}</td>
                    <td>${obj.errorCardNumber!}</td>
                    <td><a href="${web_base}/recharge/system_product!toEdit.htm?id=${(obj.id)!}">编辑库存产品</a>&nbsp;&nbsp;
                        <a href="${web_base}/recharge/card_import!cardImport.htm?systemProductId=${obj.id!}">导入库存</a>&nbsp;&nbsp;<a
                                href="${web_base}/recharge/card_info!list.htm?systemProductId=${obj.id!}">查看库存</a>

                    </td>
                </tr>
            </#list>
        </#if>
    </table>
</@pageList>
</div>
</body>
</html>